<?php $this->load->view('qt/header'); ?>


<!--  PAPER WRAP -->
<div class="wrap-fluid">
    <div class="container-fluid paper-wrap bevel tlbr">

        <!-- CONTENT -->
        <!--TITLE -->
        <div class="row">
            <div id="paper-top">
                <div class="col-sm-12">
                    <h2 class="tittle-content-header">
                        <i class="qt-network"></i>
                        <span id="title-header">
                            <?php echo (isset($this->title_header)) ? $this->title_header : 'DANH SÁCH LỊCH SỬ';?>
                        </span>
                    </h2>
                </div>
            </div>
        </div>
        <!--/ TITLE -->
        <ul id="breadcrumb">
            <li><span class="entypo-home"></span></li>
            <li><i class="fa fa-lg fa-angle-right"></i></li>
            <li><a href="#main">Trang chủ</a></li>
        </ul>
        <div class="content-wrap"  style="margin-top: 10px;">
        
        
   <section class="vbox" style="background: white; padding: 5px;">
	<section class="scrollable padder">
		<section class="row m-b-md">
			<div class="col-sm-12">
				<h3 class="m-b-xs text-black">Danh sách lịch sử</h3>
			</div>
		</section>
		<section class="scrollable padder">
		<div class="row">
			<div class="col-md-12">
            <label style="width: 100%; font-size: 16px; font-weight: normal; margin-bottom: 10px;">
            <li class="qt-search" style="float: left; list-style: none; padding:0px 5px;"></li>Tìm theo: </label>
            
				<form class="form-inline m-b-lg" method="GET" action="<?php echo base_url()?>history/view/">
                    <div class="form-group">
						<input type="text" name="where" placeholder="Tìm kiếm" class="form-control" value="<?php echo $this->input->get("where"); ?>">
					</div>

					<div class="form-group">
						<select class="form-control" name="user_id">
							<option value="">Chọn nhân viên</option>
							<?php
								foreach($this->data["result_user"] as $value){								
									?>
									<option value="<?php echo $value["uId"]?>" <?php if($this->input->get("user_id")==$value["uId"]){ echo "selected";}?>><?php echo $value["uFullname"]?></option>
									<?php
								}	
							?>
						</select>
					</div>
					<div class="form-group">
						<input type="submit" class="btn btn-primary" value="Tìm kiếm">
					</div>

				</form>

				<section class="panel b-a">
					<div class="panel-heading b-b"> <span style="min-width: 0px !important; background: #ff6700 !important;" class="badge bg-warning pull-right">
                    <?php echo count($this->data["count_page"])?></span>  
                    <a href="#" class="font-bold" style="font-size: 14px; font-weight: bold; color: #7d7d7d;">
                    
                    <li class="qt-group2" style="float: left; list-style: none; font-size: 18px;">&nbsp;</li>
                    Danh sách khách hàng</a></div>
                    <table class="table table-striped table-condensed table-hover table-bordered table-fixed" id="list_company">
						<thead>
							<tr>
								<th class="col-md-4">Hoạt Động</th>
								<th class="col-md-2">Khách Hàng</th>
								<th class="col-md-3">Nhân Viên</th>								
								<th class="col-md-3" class="text-center" width="160">Ngày Thực Thi</th>						
							</tr>
						</thead>
						<tbody>
							<?php 
							foreach($this->data["result"] as $num=>$val){								

								?>
								<tr>
								<td>
								<a href=""><?php echo $val["his_action"]?></a></td>									
									<td><a href=""><?php echo $val["cust_first_name"]." ".$val["cust_last_name"]?></a></td>
									<td><a href=""><?php echo $val["uFullname"]?></a></td>
									<td class="text-center"><?php echo date('d-m-Y h:i:s',$val["his_create_date"])?></td>
								</tr>
								<?php
							}
							?>
							

						</tbody>
						<tfoot>
							<tr>
								<td colspan="5" class="text-center">
									<ul class="pagination pagination">
									<?php 
										$config['base_url'] = base_url().'history/view';
										$config['total_rows'] = count($this->data["count_page"]);
										$config['per_page'] = 10; 
										$config['full_tag_open'] = '<li>';
										$config['full_tag_close'] = '</li>';
										$config['last_tag_open'] = '<li>';
										$config['last_tag_close'] = '</li>';
										$config['next_tag_open'] = '<li>';
										$config['next_tag_close'] = '</li>';
										$config['prev_tag_open'] = '<li>';
										$config['prev_tag_close'] = '</li>';
										$config['cur_tag_open'] = '<li><a><b>';
										$config['cur_tag_close'] = '</b></a></li>';
										$config['num_tag_open'] = '<li>';
										$config['num_tag_close'] = '</li>';
										$this->pagination->initialize($config); 
										echo $this->pagination->create_links();
									?>
										
									</ul>
								</td>
							</tr>
						</tfoot>
					</table>
				</section>
			</div>
		</div>
		</section>
	</section>
</section>


        
</div>
<div class="content-wrap" id="show-content2"></div>
<div class="content-wrap"> 
<?php $this->load->view('qt/footer'); ?>